﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Hr.DAL;
using Hr.DALContainer;
using Hr.IBLL;
using Hr.IDAL;
using Hr.Model;
namespace Hr.BLL
{
    public partial class ResumeListService 
    {
        // 实现接口
        //private IResume_ListDAL ResumeListDAL = Container.Resolve<IResume_ListDAL>();

        // 你的BLL层核心代码

        //引入Dal层
        protected ResumeListDAL Rdl = new ResumeListDAL();

        /// <summary>
  /// 获取简历信息
  /// </summary>
  /// <param name="page"></param>
  /// <param name="limit"></param>
  /// <returns></returns>
        public Dictionary<string, object> GetResumeInfo(int page, int limit)
        {
            Dictionary<string, object> dt = new Dictionary<string, object>()
            {
                {"ResumeList",Rdl.GetResumeInfo().Skip(limit*(page-1)).Take(limit) },
                {"Count",Rdl.GetResumeInfo().Count() }
            };
            return dt;
        }
        /// <summary>
        /// 模糊查询简历信息
        /// </summary>
        /// <returns>简历信息</returns>
        /// <author>赵匡涛</author>
        /// <update>null</update>
        public Dictionary<string, object> GetResume_ListAll(string Name, int page, int limit)
        {
            //return Rdl.GetResume_ListAll(Name).Skip(limit * (page - 1)).Take(limit);//调用Dal层的GetResumeInfo方法
            Dictionary<string, object> dt = new Dictionary<string, object>()
            {
                {"ResumeList",Rdl.GetResume_ListAll(Name).Skip(limit*(page-1)).Take(limit) },
                {"Count",Rdl.GetResume_ListAll(Name).Count() }
            };
            return dt;
        }
        /// <summary>
        /// 编辑添加简历信息
        /// </summary>
        /// <returns>简历信息</returns>
        /// <author>赵匡涛</author>
        /// <create>2020/8/9</create>
        /// <update>null</update>
        public bool UpdateResume(Resume_List s, string type,int pk_User)
        {
            Rdl.UpdateResume(s, type,pk_User);
            return Rdl.SaveChanges();
        }
        /// <summary>
        /// 删除简历信息
        /// </summary>
        /// <returns>简历信息</returns>
        /// <author>赵匡涛</author>
        /// <create>2020/8/9</create>
        /// <update>null</update>
        public bool DelResume_List(Resume_List s)
        {
            Rdl.DelResume_List(s);
            return Rdl.SaveChanges();
        }
        /// <summary>
        /// 选择器信息
        /// </summary>
        /// <returns></returns>
        public Dictionary<string, object> TypeListANStatusList()
        {
   
            return Rdl.TypeListANStatusList();
        }
        /// <summary>
        /// 根据简历ID查询简历信息
        /// </summary>
        /// <param name="ResumeID"></param>
        /// <returns></returns>
        public Resume_List ResumeListInfo(int ResumeID)
        {
            return Rdl.ResumeListInfo(ResumeID);//调用Dal层的GetRoleName方法
        }

        // 实现抽象类
        //public override void SetDal()
        //{
        //    Dal = ResumeListDAL;
        //}
    }
}
